package com.tisumoon.data.api;

import com.google.gson.reflect.TypeToken;
import com.tisumoon.data.abs.AbsData;
/**
<pre>
{
		"result": "searchLocal",
		"allnum": 1432,
		"allpage": 716,
		"num": "2",
		"page": 1,
		"info": [
		         {
		        	 "uid": 1000002693,
		        	 "times": "1400756118",
		        	 "distance": "23370.8707",
		        	 "info": {
		        	 		"uid": "1000002693",
		        	 		"name": "用户67845",
		        	 		"sex": "1",
		        	 		"birthday": "1402885575",
		        	 		"head": "http://x.tisumoon.com/file/workerman.recv.1402022454.datu.jpg"
		         	  },
		         	  "content": [
		                     {
		                    	 "c_id": "10000119",
		                    	 "c_thumb": "http://x.tisumoon.com/",
		                    	 "c_text": "这是一条测试的文字啊测试的文字，只有我自己才能看见
		                    		 啊看见",
		                    		 "s_text": "",
		                    		 "s_time": ""
		                     },
		                     {
		                    	 "c_id": "10000119",
		                    	 "c_thumb": "http://x.tisumoon.com/",
		                    	 "c_text": "这是一条测试的文字啊测试的文字，只有我自己才能看见
		                    		 啊看见",
		                    		 "s_text": "",
		                    		 "s_time": ""
		                     },
		                     {
		                    	 "counent_id": "10000112",
		                    	 "c_id": "10000119",
		                    	 "c_thumb": "http://x.tisumoon.com/",
		                    	 "c_text": "这是一条测试的文字啊测试的文字，只有我自己才能看见
		                    		 啊看见",
		                    		 "s_text": "",
		                    		 "s_time": ""
		                     },
		                     {
		                    	 "c_id": "10000119",
		                    	 "c_thumb": "http://x.tisumoon.com/",
		                    	 "c_text": "这是一条测试的文字啊测试的文字，只有我自己才能看见
		                    		 啊看见",
		                    		 "s_text": "",
		                    		 "s_time": ""
		                     }
		               ]
		         }
		  ]
	}
</pre>

 * @author Wei Chou
 */
public class SearchLocal extends AbsData<SearchLocal> {
	public static final String TYPE_SEARCH_LOCAL		= "searchLocal";

	public int allnum;
	public int allpage;
	public int num;
	public int page;
	public Person[] info;

	@Override
	protected TypeToken<SearchLocal> getTypeToken() {
		return new TypeToken<SearchLocal>(){};
	}

	public static class Person {
		public long uid;
		public long times;
		/**单位：米**/
		public float distance;
		public Info info;
		public Content[] content;
		/**未读邮件数（ya项目需要字段）**/
		public int mailCount;
		/**ya次数（ya项目需要字段）**/
		public int yaCount;

		public static class Info {
			public long uid;
			public String name;
			/**0女 1男**/
			public int sex;
			public long birthday;
			public String head;
		}

		public static class Content {
			public long c_id;
			/**缩略图**/
			public String c_thumb;
			public String c_text;
			public String s_text;
			public long s_time;
		}

		@Override
		public int hashCode() {
			return (int)(uid % 100);
		}

		@Override
		public boolean equals(Object o) {
			return ((Person)o).uid == uid;
		}
	}

	@Override
	protected String[] typeValues() {
		return new String[] {TYPE_SEARCH_LOCAL};
	}
}
